import http from '../../utils/http.js'


export function uploadFile(imagePath){
	return new Promise((resolve,reject)=>{
		var params={
		   url:'/v1/system/upload',
		   method:'POST',
		   data:{
			   imageUrl: imagePath,
			   name:'file'
		   },
		   callBack:(res)=>{
			let response = JSON.parse(res);
			console.log(response)      
			if(response.code==0){
			 resolve(response)
			}
			else{
			 reject(response.msg)
			}
		}
	  }
	  http.uploadImage(params)
	})
}

